//
//  CUstomViewController.m
//  27_Block
//
//  Created by 徐昊 on 16/8/19.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "CUstomViewController.h"

@interface CUstomViewController ()

@end

@implementation CUstomViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回上一页" style:UIBarButtonItemStylePlain target:self action:@selector(goBack)];
    self.title = @"我是一个标题, 呵呵呵";
}
- (void)goBack {
    if (self.passTitle) {
        self.passTitle(self.title);
    }
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)dealloc {
    [super dealloc];
    Block_release(_passTitle);
    _passTitle = nil;
    NSLog(@"secondVC 被释放了");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
